import GradualNumber from ".";
import ThreeBezier, { SpotI } from "./ThreeBezier";

export function BezierChanger(PosA: SpotI, PosB: SpotI, DeDieFalla?: number) {
	const bezier = ThreeBezier(PosA, PosB, DeDieFalla);
	return function ({ Start, Progress, Count, Length }: GradualNumber) {
		return Start + Length * bezier(Count.Value, Progress);
	}
}